//
//  CancleOutHolidayCell.m
//  AttendenceSys
//
//  Created by ld on 16/1/18.
//  Copyright © 2016年 窦芳俊. All rights reserved.
//

#import "CancleOutHolidayCell.h"

@implementation CancleOutHolidayCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self initCell];
    }
    return self;
}

- (void)initCell
{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    UIView* bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 10, [UIScreen mainScreen].bounds.size.width,Cancle_OutHolidayHeight)];
    bgView.backgroundColor = [UIColor whiteColor];
    
    _appBegEndTimeLab = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, [UIScreen mainScreen].bounds.size.width*2/3-15, 20)];
    [_appBegEndTimeLab setBackgroundColor:[UIColor clearColor]];
    _appBegEndTimeLab.font = [UIFont systemFontOfSize:16];
    [_appBegEndTimeLab setTextAlignment:NSTextAlignmentLeft];
    _appBegEndTimeLab.textColor = [UIColor blackColor];
    [bgView addSubview:_appBegEndTimeLab];

    _appInfoLab = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width-25-60, _appBegEndTimeLab.frame.origin.y, 60, _appBegEndTimeLab.frame.size.height)];
    [_appInfoLab setBackgroundColor:[UIColor clearColor]];
    _appInfoLab.font = [UIFont systemFontOfSize:16];
    [_appInfoLab setTextAlignment:NSTextAlignmentRight];
    _appInfoLab.textColor = RGB(166, 166, 166);
    [bgView addSubview:_appInfoLab];
    
    _appTimeLab = [[UILabel alloc] initWithFrame:CGRectMake(_appBegEndTimeLab.frame.origin.x, Cancle_OutHolidayHeight/2-5, [UIScreen mainScreen].bounds.size.width/2, 20)];
    [_appTimeLab setBackgroundColor:[UIColor clearColor]];
    _appTimeLab.font = [UIFont systemFontOfSize:14];
    [_appTimeLab setTextAlignment:NSTextAlignmentLeft];
    _appTimeLab.textColor = RGB(166, 166, 166);
    [bgView addSubview:_appTimeLab];
    
    //销假
    _cancleBtn = [[UIButton alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width-25-60,Cancle_OutHolidayHeight-35,60,20)];
    //    [_loginBtn setBackgroundImage:[UIImage imageNamed:@"bg_student_activited@2x.png"] forState:UIControlStateNormal];
    [_cancleBtn setTitle:@"销假" forState:UIControlStateNormal];
    [_cancleBtn addTarget:self action:@selector(cancleOutHoliday) forControlEvents:UIControlEventTouchUpInside];
    [_cancleBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    _cancleBtn.backgroundColor = RGB(252, 119, 62);
    [bgView addSubview:_cancleBtn];
    
    [self.contentView addSubview:bgView];
}

//销假
-(void)cancleOutHoliday
{

}

-(NSString*)appInfoForAppType:(ApproveType)appType
{
    NSString* sInfo = @"未知";
    if (Approve_YES == appType) {
        sInfo = @"已审核";
    }
    else if (Approve_NO == appType)
    {
        sInfo = @"待审核";
    }
    return sInfo;
}

@end
